package cn.yes.like;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppCore {
    public static void main(String[] args) throws Exception{
        Class<?> HH = Class.forName("cn.yes.like.CustomerService");
        Object h = HH.newInstance();
        Field service = HH.getDeclaredField("service");
        service.setAccessible(true);
        Class<?> VV = Class.forName("cn.yes.like.UserService");
        Object v = VV.newInstance();
        service.set(h,v);
        Method say = HH.getMethod("say");
        System.out.println(say.invoke(h));


    }
}
